package com.itheima.Demo10printstream;

import java.io.*;

//打印流 直接打印写的内容
public class PrintStreamDemo1
{
    public static void main(String[] args) {
        //打印字节 一般只用打印功能 不用写功能
        try (PrintStream p1 = new PrintStream(new FileOutputStream("src\\com\\itheima\\Demo10printstream\\java"))) {
            p1.println("hello world");
        }catch(Exception e)
        {
            e.printStackTrace();
        }
        //打印字符
        try (PrintWriter p2 = new PrintWriter(new FileWriter("src\\com\\itheima\\Demo10printstream\\java"))){

        }catch (Exception e)
        {
            e.printStackTrace();
        }

    }
}
